<!doctype html>
<html>

	<head>
		<meta charset="UTF-8">
		<title></title>
		<meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no" />
		<link href="../../css/mui.min.css" rel="stylesheet" />
		<link rel="stylesheet" type="text/css" href="../../css/common.css" />
		<style type="text/css">
			.feed_text {
				padding: 20px 14px 14px;
			}
			
			.feed_text textarea {
				border: none;
				margin: 0;
				border-radius: 8px;
				font-size: 12px;
			}
			
			.feed_phone {
				padding: 0 14px 14px;
			}
			
			.feed_phone input {
				border: none;
				margin: 0;
				border-radius: 8px;
				font-size: 12px;
			}
			
			.prompt {
				padding: 4px 14px;
				font-size: 12px;
				color: #999;
			}
			
			.prompt>div:first-child {
				padding-left: 20px;
				background: url(../../images/AKyk.png)no-repeat 0 center;
				background-size: 16px;
				margin-bottom: 4px;
			}
			
			.feed_footer {
				position: fixed;
				top: calc(100% - 40px);
				width: 100%;
			}
			
			.feed_footer button {
				background: #da2332;
				border-color: #da2332;
				height: 40px;
				width: 100%;
				border-radius: 0;
			}
		</style>
	</head>

	<body>
		<div id="feedback">
			<header class="mui-bar mui-bar-nav">
				<a class="mui-action-back mui-icon mui-icon-arrowleft mui-pull-left"></a>
				<h1 class="mui-title">意见反馈</h1>
			</header>
			<div class="mui-content">
				<div class="feed_text">
					<textarea rows="8" cols="8" placeholder="请留下您的宝贵意见和建议，我们将努力改进"></textarea>
				</div>
				<div class="feed_phone"><input type="text" placeholder="请留下您的手机号，以便我们回复您" /></div>
				<div class="prompt">
					<div>温馨提示：</div>
					<div>如果您在使用过程中遇到任何问题，或者对我们有任何意见、建 议，欢迎您向我们提交，我们将用心倾听，不断优化，为您提供 更优质的服务。
					</div>
				</div>
			</div>

			<div class="feed_footer">
				<button type="button" class="mui-btn mui-btn-danger">提交订单</button>
			</div>
		</div>

		<script src="../../js/mui.min.js"></script>
		<script src="../../js/libs/zepto.js"></script>
		<script src="../../js/common.js"></script>
		<script type="text/javascript">
			mui.init({
			})
			var resizeHeight = document.documentElement.clientHeight || document.body.clientHeight;
			$(".feed_footer").css('top', resizeHeight - 40)
			var swith = false
			$(".feed_footer").on("tap", function() {
				if(swith) {
					return
				}
				if(common.replace($(".feed_text textarea").val()) == '') {
					common.toast("请留下您的宝贵意见和建议")
					return
				} else if(common.phone.test($(".feed_phone input").val()) == '') {
					common.toast("请输入正确的手机号码")
					return
				}
				swith = true
				common.ajax('/userCenter/submitComments', {
					content: $(".feed_text textarea").val(),
					mobile: $(".feed_phone input").val()
				}, function(data) {
					swith = false
					if(data.code == 1) {
						common.toast("感谢您提供的宝贵意见和建议")
						$(".feed_text textarea").val("")
						$(".feed_phone input").val("")
					} else {
						if(data.resultMsg) {
							common.toast(data.resultMsg)
						} else {
							console.log(data)
						}
					}
				})
			})
		</script>
	</body>

</html>